package ch02;
import java.util.Scanner;
/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/2
 */
class If2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入订票月份: ");
        int month = scanner.nextInt();
        System.out.print("请输入订票日期: ");
        int day = scanner.nextInt();
        System.out.print("请输入机票原价: ");
        double originalPrice = scanner.nextDouble();
        double discountedPrice;
        if ((month == 1 && (day >= 1 && day <= 3)) || (month == 5 && (day >= 1 && day <= 3)) || (month == 10 && (day >= 1 && day <= 7))) {
            discountedPrice = originalPrice;
        } else {
            discountedPrice = originalPrice * 0.8;
        }
        System.out.println("应付金额为: " + discountedPrice + " 元");
        scanner.close();
    }
}
